package com.jet.goods.remote.stock;

import com.jet.core.result.ResultJson;
import com.jet.goods.remote.stock.dto.StockSpuDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @author dcl
 * @since 2025/2/21 13:44
 */
@FeignClient(contextId = "GoodsStockRemote", value = "mammon-merchant", fallbackFactory = GoodsStockRemoteFallback.class)
public interface GoodsStockRemoteFeign {

    @PostMapping("/inner/stock-spu")
    ResultJson<Void> async(@RequestParam long merchantNo, @RequestBody StockSpuDto dto);

    @PutMapping("/inner/stock-spu/status")
    ResultJson<Void> asyncStatus(@RequestParam long merchantNo,
                                 @RequestParam String spuId,
                                 @RequestParam int status);

    @DeleteMapping("/inner/stock-spu")
    ResultJson<Void> deleteBySpuId(@RequestParam long merchantNo, @RequestParam String spuId);

    @DeleteMapping("/inner/stock-sku")
    ResultJson<Void> deleteBySkuId(@RequestParam String skuId);
}
